using Snake.Logger;
using Snake.Misc;
using UnityEngine;

public class TestEllipse : MonoBehaviour
{
    private Plane _plane = new Plane(Vector3.forward, 0f);

    // Update is called once per frame
    void Update()
    {
        var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        _plane.Raycast(ray, out var d);
        var cp = ray.GetPoint(d);
        transform.position = cp;
        var len = Utils.OverlapEllipseNonAlloc(cp, transform.localScale.x * 0.5f, transform.localScale.y * 0.5f,
                                               out var results);
        Log.Info(len);
    }
}